import libxml2
doc = libxml2.parseFile("miCasa.xml")
cont = doc.xpathNewContext()
sol = cont.xpathEval("//puerta/@idP")

print 'Puertas a: '

for i in sol:
        print str(i)

doc.freeDoc()
cont.xpathFreeContext()
